CXX    = g++
CFLAGS = -g -O2 -fPIC -Wall -Wno-write-strings $(shell root-config --cflags)
LIBS   = $(shell root-config --glibs) -lFoam -lRooFit -lRooFitCore -lMinuit -lboost_regex -lboost_thread

H      = $(shell ls *.h)
SRC    = $(shell ls *.cxx)
OBJ    = $(patsubst %.cxx,%.o,$(SRC))

%.o: %.cxx $(H)
	$(CXX) $(CFLAGS) -c $< -o $@

%.o: %.h $(H)
	$(CXX) $(CFLAGS) -c $< -o $@

all: $(OBJ) $(H)

clean:
	rm -rf *.o *~
